﻿using Sys.Core.Tour;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class TicketList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!IsPostBack)
            {
                Home mas = Master as Home;

                mas.SetHead("门票预订", "门票预订", "门票预订");
            }
        }
    }

    public string GetTicketList()
    {
        System.Text.StringBuilder sb = new System.Text.StringBuilder();

        var list = TicketBll.I.Entities.OrderByDescending(m => m.Top).ThenByDescending(m => m.UpdateTime).ToList();

        foreach (var item in list)
        {
            sb.Append("");
            sb.Append("<div class='ticketList'>");
            sb.Append("<img src='userfiles/ticket/default/" + item.Img + "' class='img'/>");
            sb.Append("<div class='ticketInfo'>");
            sb.Append("<h4>" + item.Name + "</h4>");
            sb.Append("<p>门票价格：<b>￥" + item.Price + "</b> (儿童：￥" + item.Child + ")</p>");
            sb.Append("<a href='Ticket.aspx?id=" + item.ID + "' target='_blank'><img src='images/bt.jpg'/></a>");
            sb.Append("</div>");
            sb.Append("</div>");
        }

        return sb.ToString();
    }
}